package com.bcx.crm.java.httpServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by ys on 2018/2/28.
 * 1.加载并实例化：项目启动的时候会加载Servlet的class并进行实例化
 * 2.初始化：首次调用servlet的时候会init方法进行初始化
 * 3.服务:然后service方法会根据请求来判断是调用doGet方法还是doPost方法
 * 4.销毁:当内存紧张或者servlet长时间不用的时候调用destroy方法进行销毁(或者关闭tomcat时候)
 */
@WebServlet(urlPatterns = "/insertTemplate/123/1234")
public class TestServlet2 extends HttpServlet {
    @Override
    public void init() throws ServletException {
        super.init();
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doGet(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }

    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.service(req, resp);
    }
}
